<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/24
 * Time: 9:24
 */

namespace backend\controllers;


use backend\components\MyAction;
use backend\components\MyComponent;
use backend\components\MyFilter;
use backend\models\Test;
use yii\filters\Cors;
use yii\filters\VerbFilter;
use yii\helpers\Url;
use yii\web\Controller;
use yii\web\Response;

class TestController extends Controller
{

    public function behaviors()
    {
        return [

        ];
    }


    public function actions()
    {
        return [
            'my-action'=>[
                'class'=>MyAction::className(),
            ]
        ];
    }

    public function actionTest(){
        $component = new MyComponent();
        $component->on(MyComponent::EVENT_HELLO,function ($event){
            return "hello";
        });
    }


    public function actionIndex(){
        $component = new MyComponent();
        $component->bar();
    }
}